﻿using MediatR;
using SystemMHB.API.Application.Command.ReturnWarehouseCommand;
using SystemMHB.Domian;
using SystemMHB.Infrstructer.Interface;

namespace SystemMHB.API.Application.CommandHandlers.ReturnWarehouseCommandHandler
{
    public class ReturnWarehouseFantianCommandHandler:IRequestHandler<ReturnWarehouseFantianCommand, ReturnWarehouse>
    {
        /// <summary>
        /// 返库信息
        /// </summary>
        IReturnWarehouseRepository repository;
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="repository"></param>
        public ReturnWarehouseFantianCommandHandler(IReturnWarehouseRepository repository)
        {
            this.repository = repository;
        }

        public async Task<ReturnWarehouse> Handle(ReturnWarehouseFantianCommand request, CancellationToken cancellationToken)
        {
            return await repository.GetModelAsync(request.rWId);
        }
    }
}
